package com.aptemo.webetek.client.utils;

/**
 * Base class to extend equipment comparators from
 */
public class SortingComparator
{
	/**
	 * Ascending or descending (1 ascending, -1 descending)
	 */
	protected int	factor	= 1;

	/**
	 * Sets sorting factor according to ascending flag
	 * 
	 * @param ascending
	 */
	public SortingComparator(boolean ascending)
	{
		setAscending(ascending);
	}

	/**
	 * Sets sorting factor according to ascending flag
	 * 
	 * @param ascending
	 */
	public void setAscending(boolean ascending)
	{
		if (ascending)
			factor = 1;
		else
			factor = -1;
	}

	public int getFactor()
	{
		return factor;
	}

	public void setFactor(int factor)
	{
		this.factor = factor;
	}
}
